import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/Home.vue'
const playList = () => import('@/views/playList.vue')
const SongPage = () => import('../views/SongPage.vue')

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    //动态路由
    path: '/playlist/:id',
    name:'playlist',
    component: playList,
    props: true
  },
  {
    path: '/songpage/:id/:title',
    name:'songpage',
    component: SongPage,
    props: true
  }
]

const router = new VueRouter({
  routes
})

export default router
